import { createApp } from "vue";
import { createPinia } from "pinia";
import print from "vue3-print-nb";
/* 自定义指令 */
import directive from "@/directive";

import ElementPlus from "element-plus";
import "element-plus/dist/index.css";
import "./style.css";
import App from "./App.vue";

import * as ElementPlusIconsVue from "@element-plus/icons-vue";
import zhCn from "element-plus/es/locale/lang/zh-cn";
import "element-plus/dist/index.css";

import router from "@/router/index.ts";
import { axiosConfig } from "@/utils/axiosConfig";
import { routerConfig } from "./utils/routerConfig";

/* 阿里图标库 */
import "./assets/css/icon.css";
import "./assets/font/iconfont.css";

const pinia = createPinia();
axiosConfig();
routerConfig();

const app = createApp(App);

directive(app);
app.use(pinia).use(router).use(print).use(ElementPlus, { size: "default", locale: zhCn }).mount("#app");

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}
